(:: pragma bea:schema-type-parameter parameter="$customer1" type="ns1:Customer" location="../WSDLs/init.wsdl" ::)
(:: pragma bea:global-element-return element="ns0:InventoryCheck" location="../WSDLs/InventoryCheck.wsdl" ::)

declare namespace ns1 = "http://www.example.org/init/";
declare namespace ns0 = "http://www.example.org/InventoryCheck/";
declare namespace xf = "http://tempuri.org/flow_1/XSDs/initToInventoryCheck/";

declare function xf:initToInventoryCheck($customer1 as element())
    as element(ns0:InventoryCheck) {
        <ns0:InventoryCheck>
            <partnerId>{ data($customer1/partnerId) }</partnerId>
            <macId>{ data($customer1/services/device/macId) }</macId>
            <offerId>{ data($customer1/services/offerId) }</offerId>
            <clearwireMarketId>{ data($customer1/clearwireMarketId) }</clearwireMarketId>
            <Realm>{ data($customer1/services/device/realm) }</Realm>
            <mvnoMarketId>{ data($customer1/services/mvnoMarketId) }</mvnoMarketId>
            <mvnoReferenceNumber>{ data($customer1/mvnoReferenceNumber) }</mvnoReferenceNumber>
            {
                for $lbsType in $customer1/services/device/lbsType
                return
                    <lbsType>{ data($lbsType) }</lbsType>
            }
        </ns0:InventoryCheck>
};

declare variable $customer1 as element() external;

xf:initToInventoryCheck($customer1)